efl_version: 1 22;

collections {

   styles {
      style {
         name: "entry_style";
         // This style wraps lines at word boundaries.
         // Check Evas textblock's documentation to see all the options
         base: "font="sans" font_size=10 color=#000 wrap="word" left_margin=2 right_margin=2";
      }
   }

   group {
      name: "example/main";
      min: 12 50;

      parts {
         part {
            name: "background";
            type: RECT;
            mouse_events: 0;
            description {
               state: "default" 0.0;
               // 3 pixels of margin on left and top
               rel1.offset: 3 3;
               // 3 pixels of margin on right and bottom... -1 (default) -3 = -4
               // Look at documentation about EDC parts positioning
               rel2.offset: -4 -4;
            }
         }

         part {
            name: "example/text";
            type: TEXTBLOCK;
            scale: 1;
            // It's mandatory to set entry_mode as editable.
            entry_mode: EDITABLE;
            select_mode: DEFAULT;
            cursor_mode: UNDER;
            mouse_events: 1;
            // It causes a textblock that is editable to allow multiple lines
            // for editing.
            multiline: 1;
            // Set groups used to be used as selection effect and
            // cursor.
            source: "example/selection";
            source4: "example/cursor";
            description {
               state: "default" 0.0;
               min: 12 50;
               // Position text relative to background, with a small margin
               rel1 {
                  to: "background";
                  offset: 2 2;
               }
               rel2 {
                  to: "background";
                  offset: -3 -3;
               }
               text {
                  style: "entry_style";
                  min: 0 1;
                  align: 0.0 0.0;
               }
            }
         }
      }

      programs {
         program {
            name: "focus";
            signal: "load";
            source: "";
            action: FOCUS_SET;
            target: "example/text";
         }
      }
   }

   group {
      name: "example/selection";

      parts {
         part {
            name: "selection";
            type: RECT;
            mouse_events: 0;
            description {
               state: "default" 0.0;
               color: 180 180 180 255;
            }
         }
      }
   }

   group {
      name: "example/cursor";
      min: 1 0;

      parts {
         part {
            name: "cursor";
            type: RECT;
            mouse_events: 0;
            description {
               state: "default" 0.0;
               min: 2 12;
               color: 0 0 0 255;
            }
            description {
               state: "hidden" 0.0;
               inherit: "default" 0.0;
               color: 0 0 0 0;
            }
         }
      }

      // These programs are used to blink the cursor. They're
      // started by the "load" signal, emitted when the EDJ file is loaded.
      // It's a infinite loop between "default" and "hidden" states of
      // the "cursor" part.
      programs {
         program {
            name: "cursor_hide";
            signal: "load";
            source: "";
            action: STATE_SET "hidden" 0.0;
            target: "cursor";
            transition: SINUSOIDAL 0.2;
            after: "cursor_hide_timer";
         }
         program {
            name: "cursor_hide_timer";
            in: 0.2 0.0;
            after: "cursor_show";
         }
         program {
            name: "cursor_show";
            action: STATE_SET "default" 0.0;
            target: "cursor";
            after: "cursor_show_timer";
         }
         program {
            name: "cursor_show_timer";
            in: 0.5 0.0;
            after: "cursor_hide";
         }
      }
   }
}
